package com.zxl.util;

import java.text.DateFormat;
import java.text.ParseException;

public class DateUtil {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		boolean flag = isDateBefore("2006-09-09 12:12:12","2005-09-09 16:00:00");
		System.out.println(flag);
	}

	public static boolean isDateBefore(String date1, String date2) {
		boolean b = false;
		
		try {
			DateFormat df = DateFormat.getDateTimeInstance();
			b = df.parse(date1).before(df.parse(date2));
		} catch (ParseException e) {
			e.printStackTrace();
		}
		
		return b;
	}
}
